#ifndef SETWIG_H
#define SETWIG_H

#include <QWidget>
#include <QDebug>
#include <QMessageBox>
#include <QTextStream>
#include <QFile>
#include <QTimer>
#include<QAbstractSocket>
#include <QObject>
#include "mqtthandler.h"
#include "GlobalVal.h"
#include <QString>
//QJSON类
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>
//UDP库
#include <QUdpSocket>
#include <QHostAddress>
//TCP库
#include <QTcpSocket>
#define UDPIP "192.168.0.255"
//画家
#include <QPainter>
#include <QPixmap>

#include "recognition.h"




namespace Ui {
class SetWig;
}

class SetWig : public QWidget
{
    Q_OBJECT

public:
    explicit SetWig(QWidget *parent = 0);
    ~SetWig();

private:
    recognition* pr; // 第二个界面类对象
    Ui::SetWig *ui;
    QString tcpip;
    QUdpSocket *udpSocket;//udp socket对象
    QTcpSocket *tcpSocket1;//TCP客户端对象
    QTcpSocket *tcpSocket2;
    quint16 senderPort;
    QTimer *timer;
    QString Path="D:/ls.c";
    QString filename="lsd.c";

protected:
    void paintEvent(QPaintEvent* event);


private slots:
    void btnSearchSlot();
    void udpRecvSlot();
    void btnConnectSolt();
    void tcpSecondConnectSlot();
    void tcpSendFileSlot();
    void timeoutHeartSlot();
    void disconnectedSlot();
    void btnpatternSlot();
    void openFun();//开始识别

signals:
    void disconnectTcpSignal();
    // 自定义信号
    void openSignal();


};

#endif // SETWIG_H
